import { EntitySchema } from '@mikro-orm/core';

export class LeOrderFreightGoods {
  id!: string;
  freightId!: string;
  orderGoodsId!: string;
  bagGoodsNumber!: number;
  createdTime?: number = 0;
  updatedTime?: number = 0;
  deletedTime?: number = 0;
  isDeleted?: number = 0;
}

export const LeOrderFreightGoodsSchema = new EntitySchema({
  class: LeOrderFreightGoods,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    freightId: { type: 'string', columnType: 'bigint', index: '包裹id' },
    orderGoodsId: { type: 'string', columnType: 'bigint', index: '订单商品id' },
    bagGoodsNumber: { type: 'number' },
    createdTime: { type: 'number', nullable: true, default: 0 },
    updatedTime: { type: 'number', nullable: true, default: 0 },
    deletedTime: { type: 'number', nullable: true, default: 0 },
    isDeleted: { type: 'number', columnType: 'tinyint', nullable: true, default: 0 },
  },
});
